home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 62 / 062.d81 / dir to var (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  2KB  |  69 lines

  1. 230 :
  2. 250 rem lines 330, 340 and 350 are
  3. 260 rem 'key' lines to be included in
  4. 270 rem in any use of dir to var.
  5. 280 rem these three lines should be at
  6. 290 rem the beginning of your program.
  7. 300 :
  8. 330 poke147,0:sys57812"dirtovar.o",8,1:sys62631
  9. 340 poke55,.:poke56,141:clr:rem lower top of basic
  10. 350 dim type$(144),name$(144),le$(144):rem dim these arrays first
  11. 360 :
  12. 370 printchr$(14)"[147][204]oading directory info..."
  13. 380 sys 36096:rem directory-to-variables    sub-routine
  14. 390 :rem ---------------------------
  15. 400 :
  16. 410 rem demonstration of one way in
  17. 420 rem which the results of dirtovar.o
  18. 430 rem can be used.
  19. 440 :
  20. 450 poke53280,6:poke53281,6:poke646,1
  21. 460 po$=""
  22. 470 bl$="                "
  23. 480 print"[147][213]se [195][210][211][210] [213][208]/[196][207][215][206] and [210][197][212][213][210][206] to select."
  24. 500 x=0:fi=1:if na$(1)="" then 860
  25. 510 if fi<1 then fi=1
  26. 520 if na$(fi)="" then fi=1
  27. 530 if fi>138 then fi=138
  28. 540 :
  29. 550 printpo$
  30. 560 :
  31. 570 forl=0to6 : i=fi+l
  32. 580 if i>144orna$(i)=""thenprinttab(8);bl$:goto620
  33. 590 if na$(i+1)=""and(l<x)thenx=l
  34. 600 if i=fi+x then print tab(8);"";na$(i);left$(bl$,16-len(na$(i))):goto620
  35. 610 printtab(8);na$(i);left$(bl$,16-len(na$(i)))
  36. 620 next
  37. 630 :
  38. 640 get q$:if q$=""then 640
  39. 650 if q$<>"[145]"then goto 690
  40. 660 if x=0 then fi=fi-1:goto510
  41. 670 x=x-1:goto550
  42. 680 :
  43. 690 if q$<>""then goto 730
  44. 700 if x=6 then fi=fi+1:goto520
  45. 710 x=x+1:goto550
  46. 720 :
  47. 730 if q$=chr$(13) then 760
  48. 740 goto 640
  49. 750 :
  50. 760 fi=fi+x
  51. 770 print"[147]"tp$"[217]ou chose the filename: "na$(fi)
  52. 780 print"[212]his file is of type: "ty$(fi)
  53. 790 print"[201]t has a block-length of: "le$(fi)
  54. 800 print"[201]ts disk is named: "na$(0)
  55. 810 print"[212]he disk [201].[196]. is: "ty$(0)
  56. 820 print"[194]locks free on this disk is: "le$(0)
  57. 830 print"[208]ress any key to continue."
  58. 840 get q$:if q$="" then 840
  59. 850 goto 870
  60. 860 print"[147]"tp$" [212]here are no files on this disk!":fori=0to2999:next
  61. 870 print"[147]"tp$" [195]hoose option:"
  62. 880 print" <a> [210]un again"
  63. 890 print" <b> [210]eturn to [204][207][193][196][211][212][193][210]"
  64. 900 get q$:if q$<"a"orq$>"b"then900
  65. 920 if q$="a" then run
  66. 930 open 15,8,15,"r0:hello connect=hello connect":input#15,ex,ex$,et,es:close15
  67. 940 if ex<>63 then end
  68. 950 load "hello connect",8,1
  69.